{extend name="public/base" /}
{block name="body"}
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
			<div class="widget-head">
				<div class="widget-title">{$title}</div>
			</div>
			<form id="my-form" class="layui-form" method="post">
				<div class="widget-body layui-col-lg12">
					<div class="layui-form-item">
						<label class="layui-form-label form-require">文章分类</label>
						<div class="layui-input-block">
							<select name="cate" >
								<option value="0">选择分类</option>
								{volist name="category" id="item"}
                        		<option value="{$item.id}" {if condition="$info['cate'] eq $item.id"}selected="selected"{/if}>{$item.cname}
                        		</option>
                        		{/volist}
							</select>
						</div>
					</div> 
					<div class="layui-form-item">
						<label class="layui-form-label form-require">标题</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="title" value="{$info.title}" placeholder="请输入文章标题" required>
						</div>
					</div>					
					<div class="layui-form-item">
						<label class="layui-form-label">作者</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="author" value="{$info.author}" placeholder="请输入作者">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">封面</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="image" value="{$info.image}" placeholder="请上传图片">
							<button type="button" class="layui-btn layui-btn-position ajax-images"><i class="fa fa-file-image-o"></i> 选择图片</button>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label form-require">内容</label>
						<div class="layui-input-block">
							<textarea name="content" placeholder="请输入详情内容" id="editor" style="height:400px;">{$info.content}</textarea>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">关键字</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="keyword" value="{$info.keyword}" placeholder="请输入关键字">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">描述</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="desc" value="{$info.desc}" placeholder="请输入描述">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">是否发布</label>
						<div class="layui-input-block">
							<input type="radio" name="status" value="1" title="是" {eq name="info['status']" value="1"}checked{/eq}>
                    		<input type="radio" name="status" value="0" title="否" {eq name="info['status']" value="0"}checked{/eq}>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">是否置顶</label>
						<div class="layui-input-block">
							<input type="radio" name="is_top" value="1" title="是" {eq name="info['is_top']" value="1"}checked{/eq}>
                    		<input type="radio" name="is_top" value="0" title="否" {eq name="info['is_top']" value="0"}checked{/eq}>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<input type="hidden" name="id" value="{$info.id}">
							<button class="layui-btn" lay-filter="*" lay-submit="">保存</button>
                    		<button class="layui-btn layui-btn-primary" onclick="javascript:history.back(-1);return false;">返回</button>
						</div>						
					</div>
				</div>
			</form>
		</div>
    </div>
</div>
{/block}
{block name="js"}
<script src="/static/libs/ueditor/ueditor.config.js"></script>
<script src="/static/libs/ueditor/ueditor.all.min.js"></script>
<script src="/static/libs/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>
    UE.getEditor('editor',{
        // initialFrameWidth :800,// 设置编辑器宽度
        initialFrameHeight:400,// 设置编辑器高度
        scaleEnabled:true
    });
</script>
{/block}